﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BaseArith {
    public interface ITree<T> {
        int GetDepth(INode<T> node);
        INode<T>[] GetChildren(INode<T> pn);
        bool IsLeaf(INode<T> node);
        INode<T> GetParent(INode<T> pc);
        void Add(INode<T> node);
        void Remove(INode<T> node);
        IEnumerable<INode<T>> Query(TreeTraversalType ttt = TreeTraversalType.Pre);
        IEnumerable<INode<T>> Query(INode<T> subnode,TreeTraversalType ttt = TreeTraversalType.Pre);
        int pCount { get; }
        int pDepth { get; }
        double GetWeight(INode<T> node);
    }
    public enum TreeTraversalType {
        Pre, In, Post
    }
}
